'''
* This is the projet for Brtc LlmOps Platform
* @Author Leon-liao <liaosiliang@alltman.com>
* @Description //TODO 
* @File: tool_entity.py
* @Time: 2025/9/22
* @All Rights Reserve By Brtc
'''
from enum import Enum
from typing import Optional, Any
from pydantic import BaseModel, Field

class ToolParamType(str, Enum):
    """工具参数枚举类"""
    STRING = "string"
    NUMBER = "number"
    BOOLEAN = "boolean"
    SELECT= "select"

class ToolParam(BaseModel):
    name:str # 参数名称
    label:str # 参数标签
    type:ToolParamType # 参数类型
    required:bool = False # 参数是否必填
    default:Optional[Any] = None # 默认值
    min:Optional[float]= None # 最小值
    max: Optional[float] = None  # 最大值
    options:list[dict[str, Any]] = Field(default_factory=list) # 下拉菜单选项

class ToolEntity(BaseModel):
    """工具实体类描述信息一般存储在 提供商文件下面 的  工具名称.yaml文件下"""
    name:str # 工具名称
    label:str # 工具标签
    description:str # 工具描述
    params:list[ToolParam] = Field(default_factory=list)